class CulturalHeritage::IncidencesAvatarsController < ApplicationController
  # GET /cultural_heritage/incidences_avatars
  # GET /cultural_heritage/incidences_avatars.xml
  def index
    @cultural_heritage_incidences_avatars = CulturalHeritage::IncidencesAvatar.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @cultural_heritage_incidences_avatars }
    end
  end

  # GET /cultural_heritage/incidences_avatars/1
  # GET /cultural_heritage/incidences_avatars/1.xml
  def show
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @cultural_heritage_incidences_avatar }
    end
  end

  # GET /cultural_heritage/incidences_avatars/new
  # GET /cultural_heritage/incidences_avatars/new.xml
  def new
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @cultural_heritage_incidences_avatar }
    end
  end

  # GET /cultural_heritage/incidences_avatars/1/edit
  def edit
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.find(params[:id])
  end

  # POST /cultural_heritage/incidences_avatars
  # POST /cultural_heritage/incidences_avatars.xml
  def create
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.new(params[:cultural_heritage_incidences_avatar])

    respond_to do |format|
      if @cultural_heritage_incidences_avatar.save
        format.html { redirect_to(@cultural_heritage_incidences_avatar, :notice => 'Incidences avatar was successfully created.') }
        format.xml  { render :xml => @cultural_heritage_incidences_avatar, :status => :created, :location => @cultural_heritage_incidences_avatar }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @cultural_heritage_incidences_avatar.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /cultural_heritage/incidences_avatars/1
  # PUT /cultural_heritage/incidences_avatars/1.xml
  def update
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.find(params[:id])

    respond_to do |format|
      if @cultural_heritage_incidences_avatar.update_attributes(params[:cultural_heritage_incidences_avatar])
        format.html { redirect_to(@cultural_heritage_incidences_avatar, :notice => 'Incidences avatar was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @cultural_heritage_incidences_avatar.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /cultural_heritage/incidences_avatars/1
  # DELETE /cultural_heritage/incidences_avatars/1.xml
  def destroy
    @cultural_heritage_incidences_avatar = CulturalHeritage::IncidencesAvatar.find(params[:id])
    @cultural_heritage_incidences_avatar.destroy

    respond_to do |format|
      format.html { redirect_to(cultural_heritage_incidences_avatars_url) }
      format.xml  { head :ok }
    end
  end
end
